<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s" %>
<%@ taglib uri="/struts-dojo-tags" prefix="sx"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%
	java.util.Date currTime = new java.util.Date();
	SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
	String strTime = "";
	strTime = sdf.format(currTime);
%>

<html>
	<head>
		<title>收入页面</title>
		<script type="text/javascript"> 
			function IsNum(obj){
			var val = obj.value;
			var one = val.substr(0,1);
			obj.value = (parseInt(val) || '');
			//obj.value = one != '0'? (parseInt(val) || '') : one + (parseInt(val.substr(1,val.length)) || '');
			}
		</script>		
		<link rel="stylesheet" type="text/css" href='<s:url value="/styles.css" />'>
		<sx:head/>
	</head>
	<body>
		<s:include value="header.jsp" />
		<s:if test="#session['user'] != null">
			<div class="divNavigatorOuterFrame">
				<div class="divNavigatorInnerFrame" style="text-align: right;">
					欢迎<s:property value="#session['user'].name" />&nbsp;&nbsp;
				</div>
			</div>
			<div class="divWhiteLine"></div>
		</s:if>		
		<s:form action="IncomeAction_newIncome.action" theme="simple" method="post">
		<table>
			<tr>
				<td colspan="2" class="tdHeader"><s:if test="status == null">添加</s:if ><s:else><s:label name="status"/></s:else>收入</td>
				<s:hidden name="status"/>
				<s:hidden name="income.id"/>				
			</tr>
			<tr>
				<td class="tdFormLabel">收入时间:</td>
				<td class="tdFormControl">
					<s:textfield name="income.incomedate" cssClass="text"/>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">工资(元):</td>
				<td class="tdFormControl">
					<s:textfield name="income.wage" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>wage</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">报销(元):</td>
				<td class="tdFormControl">
					<s:textfield name="income.expenseacc" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>expenseacc</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">其他(元):</td>
				<td class="tdFormControl">
					<s:textfield name="income.others" cssClass="text" onkeyup="javascript:IsNum(this)"/>
					<font class="fonterror"><s:fielderror><s:param>others</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td class="tdFormLabel">备注:</td>
				<td class="tdFormControl">
					<s:textarea colspan="1" name="income.comments" cssClass="text" />
					<font class="fonterror"><s:fielderror><s:param>comments</s:param></s:fielderror></font>
				</td>
			</tr>
			<tr>
				<td colspan="2"></td>
			</tr>
		</table>
		<table align="right">
			<tr>			
				<td><s:submit cssClass="btn" value="确定"/></td>
			</tr>
		</table>
		</s:form>
	</body>
</html>